<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <p:tabMenu activeIndex="0">  
            <p:menuitem value="Perfil" url="./subsites/perfil.xhtml" icon="ui-icon-star"/>  
            <p:menuitem value="Carro" url="./subsites/carro.xhtml" icon="ui-icon-star" />  
            <p:menuitem value="Dados" url="./subsites/dados.xhtml" icon="ui-icon-star"/>  
            <p:menuitem value="Viagem" url="./subsites/viagem.xhtml" icon="ui-icon-star" />  
        </p:tabMenu>
        <h:form>
            <p:dataTable value="#{viagemBean.viagens}" var="viagens">
                <p:column headerText="Data" >
                    <h:outputText value="#{viagens.dataViagem.time}">
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </h:outputText>
                </p:column>

                <p:column headerText="Descricao" >
                    <h:outputText value="#{viagens.obs}"/>    
                </p:column>

                <p:column headerText="Rota" >
                    <h:outputText value="#{viagens.rota}"/>
                </p:column>
                
                <p:column headerText="Remove" >
                    <h:commandButton action="#{viagemBean.destroi()}" value="Remover"/> 
                </p:column>
            </p:dataTable>
        </h:form>
    </h:body>
</html>

